Skip to content

Conversation

@mvlofthus
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work Mackenzie, you hit the learning goals here. Well done. I had a few comments on space/time complexity but otherwise this is good work.

Comment on lines +43 to 45
# Time Complexity: O(log n) if balanced, up to O(n) if unbalanced
# Space Complexity: O(log n) if balanced, up to O(n) if unbalanced
def find(key)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +19 to +21
# Time Complexity: O(log n) if balanced, up to O(n) if unbalanced
# Space Complexity: O(log n) if balanced, up to O(n) if unbalanced
def add(key, value = nil)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +65 to 67
# Time Complexity: O(n)
# Space Complexity: O(n)
def inorder

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +79 to 81
# Time Complexity: O(n)
# Space Complexity: O(n)
def preorder

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +94 to 96
# Time Complexity: O(n)
# Space Complexity: O(n)
def postorder

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +108 to 110
# Time Complexity: O(n)
# Space Complexity: O(n)
def height

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 The space complexity here is O(h) where h is the height. Otherwise correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants